package net.sky.oa.test.dao.talkpark;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.junit.Test;
import org.springframework.test.annotation.Rollback;
import net.sky.oa.dao.talkpark.TalBoxDao;
import net.sky.oa.model.TalBox;
import net.sky.oa.test.BaseTestCase;

public class TalBoxDaoTestCase extends BaseTestCase {

	@Resource
	private TalBoxDao talboxdao;
	
	@Test
	@Rollback(false)
	public void save()
	{
		System.out.println("---TalboxDaoTest----");
		TalBox talbox=new TalBox();
		talbox.setUser(null);
		talbox.setContent("test");
		talbox.setCreatetime(new Date());
		talbox.setIsshow(1);
		talbox.setStatus(1);
		talbox.setTitle("testok");
		talbox.setType(1);
		talboxdao.save(talbox);
	}
	
	@Test
	@Rollback(false)
	public void list()
	{
		List<TalBox> list=this.talboxdao.findAllTalbox();
		for(TalBox talbox : list)
		{
		 System.out.println("result: "+talbox.getTitle());	
		}
	}
	
	@Test
	@Rollback(false)
	public void delete()
	{
		TalBox talbox=new TalBox();
		Long s = 3L;
		talbox.setId(s);
		this.talboxdao.remove(s);
		
	}
	
}
